﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using RoofRunner.GameComponents;
using RoofRunner.GameComponents.Rendering;

namespace RoofRunner.Actors
{
    public class ActorMap : Dictionary<Guid, Actor>
    {
        #region Methods
        public void LoadContent(ContentManager content)
        {
            foreach (var x in this.Values)
                x.LoadContent(content);
        }



        public void Update(GameTime gameTime)
        {
            foreach (var x in this.Values)
                x.Update(gameTime);
        }



        public void PreRender(GameTime gameTime)
        {
            foreach (var x in this.Values)
                x.PreRender(gameTime);
        }

        public void Render(GameTime gameTime, RenderWorld renderWorld)
        {
            foreach (var x in this.Values)
                x.Render(gameTime, renderWorld);
        }



        public void Add(Actor a)
        {
            a.ID = Guid.NewGuid();
            this.Add(a.ID, a);
        }
        #endregion // Methods
    }
}
